<extend name="Public/base" />

<block name="body">
    <form method="POST" id="orderlist" action="">
        <!-- 标题栏 -->
        <div class="main-title">
            <h2>用户管理</h2>
        </div>
        <div class="cf">
            <!-- 高级搜索 -->
            <div class="search-form fr cf">
                <div class="sleft" style="margin-right: 2px;">
                    <select name="status"  style="height: 30px;width:120px">
                        <option value="" {$status ==""?'selected':''}>全部</option>
                        <option value="2" {$status =="2"?'selected':''}>未审核</option>
                        <option value="5" {$status =="5"?'selected':''}>已审核</option>
                    </select>
                </div>
                <div class="sleft" style="margin-right: 2px;">
                    <input type="text" name="realName" class="search-input" value="{:I('realName')}"  placeholder="用户姓名" style="height: 30px;width:80px">
                </div>
                <div class="sleft" style="margin-right: 2px;">
                    <input type="text" name="phone" class="search-input" value="{:I('phone')}"  placeholder="手机号" style="height: 30px;width:100px">
                </div>
                <div class="sleft" style="margin-right: 2px;">
                    <input type="text" name="shopName" class="search-input" value="{:I('shopName')}"  placeholder="公司名称" style="height: 30px;width:100px">
                </div>
                <div class="sleft">
                    <input type="text" name="street" class="search-input" value="{:I('street')}" placeholder="公司地址">
                    <a class="sch-btn" href="javascript:;" id="search" url="{:U('usermanagement')}"><i class="btn-search"></i></a>
                </div>
            </div>
        </div>


        <!-- 数据列表 -->
        <div class="data-table table-striped">
            <table class="">
                <thead>
                <tr>
                    <th class="">uid</th>
                    <th class="">用户姓名</th>
                    <th>联系电话</th>
                    <th>省市</th>
                    <th>公司名称</th>
                    <th>公司地址</th>
                    <th>注册时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <notempty name="_list">
                    <volist name="_list" id="vo">
                        <tr>
                            <td>{$vo.id} </td>
                            <td>{$vo.realName}</td>
                            <td>{$vo.phone}</td>
                            <td>{$vo.province}{$vo.city}</td>
                            <td>{$vo.shopName}</td>
                            <td>{$vo.street}</td>
                            <td>{$vo.createAt|time_format}</td>
                            <td>{$vo.statusname}</td>
                            <td><a href="{:U('appposter/userdetail?id='.$vo['id'])}" class="btn btn-primary">明细</a>
                            </td>
                        </tr>
                    </volist>
                    <else/>
                    <td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
                </notempty>
                </tbody>
            </table>
        </div>
        <div class="page">
            {$_page}
        </div>
    </form>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
        $("#search").click(function () {
            var url = $(this).attr('url');

            var query = $('.search-form').find('input').serialize();
            var queryselect = $('.search-form').find('select').serialize();

            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            queryselect = queryselect.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            queryselect = queryselect.replace(/^&/g, '');

            if (url.indexOf('?') > 0) {
                url += '&' + query;
                url += '&' + queryselect;
            } else {
                url += '?' + query;
                url += '?' + queryselect;
            }

            window.location.href = url+='&first=1';
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });

        //导航高亮
        highlight_subnav('{:U('appposter/usermanagement')}');
    </script>
</block>
